Skip to content

Replace all f-strings to use .format#756

Merged
schmelz21 merged 6 commits intodevelopfrom
CRASM_1073_fstrings_to_format
Jan 17, 2025
Merged

Replace all f-strings to use .format#756
schmelz21 merged 6 commits intodevelopfrom
CRASM_1073_fstrings_to_format

Conversation

@JCantu248
Copy link
Contributor

🗣 Description

Replace all Python f-strings to use the .format() method for formatting.

💭 Motivation and context

In the interest of security against injection attacks, all Python f-strings have been replaced with their equivalent with the format() method.

🧪 Testing

Tested by rebuilding the entire project, and running the entire PyTest suite.

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All future TODOs are captured in issues, which are referenced
    in code comments.
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All relevant repo and/or project documentation has been updated
    to reflect the changes in this PR.
  • Tests have been added and/or modified to cover the changes in this PR.
  • All new and existing tests pass.

@aloftus23
Copy link
Contributor

Looks like the pylint is failing in the Backend Pipeline / Test (pull_request)

I guess they want you to use %s with logger instead of format. Not sure why

@schmelz21 schmelz21 self-requested a review January 17, 2025 15:39
Copy link
Contributor

@aloftus23 aloftus23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good!

Also went through the full local build process and tested all frontend pages. 👍

Copy link
Contributor

@nickviola nickviola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@schmelz21 schmelz21 merged commit 7dbfe7f into develop Jan 17, 2025
@schmelz21 schmelz21 deleted the CRASM_1073_fstrings_to_format branch January 17, 2025 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants